
import java.io.IOException;
import java.util.StringTokenizer;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;

public class CollaborativeFiltering {

	
	public static class Map 
    extends Mapper<LongWritable, Text, Text, IntWritable>{
		//zhe edit 
	}

	public static class Reduce
    extends Reducer<Text,IntWritable,Text,IntWritable> {
		
	}
	
	
	public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException {
		Configuration conf = new Configuration(); 
	    String[] otherArgs = new String[2];
	    otherArgs[0] = args[0];
	    otherArgs[1] = args[1];
	    
	    if (otherArgs.length != 2) {
	      System.err.println("Usage: WordCount <in> <out>");
	      System.exit(2);
	    }
	    
	    Job job = new Job(conf, "CollaborativeFiltering");
	    job.setJarByClass(CollaborativeFiltering.class);
	    
	    job.setMapperClass(Map.class);
	    job.setReducerClass(Reduce.class);
	   
	    // uncomment the following line to add the Combiner
	    job.setCombinerClass(Reduce.class);
	     

	    // set output key type   
	    job.setOutputKeyClass(Text.class);
	    // set output value type
	    job.setOutputValueClass(IntWritable.class);
	    //set the HDFS path of the input data
	    FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
	    // set the HDFS path for the output
	    FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));

	    //Wait till job completion
	    System.exit(job.waitForCompletion(true) ? 0 : 1);
	  }
}
